package com.tutorial.graphics;


import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JWindow;

public class ShowGIF extends JWindow{
	
	public ShowGIF(){
		init();
		this.setVisible(true);
	}
	
	public void init(){
		int $1 = 1;
		this.setBounds(0, 0, 100, 100);
		ShowGifPanel p = new ShowGifPanel();
		this.getContentPane().add(p);
	}
	
	public static void main(String[] args) {
		ShowGIF f = new ShowGIF();
		com.sun.awt.AWTUtilities.setWindowOpacity(f, 0.5f);
	}
}
class ShowGifPanel extends JPanel{
    ImageIcon image = new ImageIcon("img/java.gif");

    public ShowGifPanel(){
    	this.setPreferredSize(new Dimension(100,100));
    }
    
    @Override
    protected void paintComponent(Graphics g) {
    	g.drawImage(image.getImage(), 0, 0, this);
    }
    
//    public void paint(Graphics g) {
//        g.drawImage(image.getImage(), 0, 0, this);
//    }
}